// Proto 生成的类型定义

export interface ActivityType {
  id: string;
  name: string;
  coinValue: number;
  color: string;
  icon: string;
  isCustom: boolean;
  createdAt: Date;
  updatedAt: Date;
}

export interface MoodConfig {
  id: string;
  name: string;
  emoji: string;
  coinModifier: number;
  color: string;
  createdAt: Date;
  updatedAt: Date;
}

export interface Activity {
  id: string;
  userId: string;
  title: string;
  activityType: string;
  content: string;
  mood: string;
  coinChange: number;
  images: string[];
  timestamp: Date;
  createdAt: Date;
  updatedAt: Date;
}

export interface UserSettings {
  userId: string;
  activityTypes: ActivityType[];
  moodConfigs: MoodConfig[];
  dailyGoal: number;
  notificationsEnabled: boolean;
  theme: string;
  updatedAt: Date;
}

export interface User {
  id: string;
  username: string;
  email: string;
  currentCoins: number;
  totalEarnedCoins: number;
  createdAt: Date;
  lastLogin: Date;
}

// 请求类型
export interface CreateActivityRequest {
  title: string;
  activityType: string;
  content: string;
  mood: string;
  images: string[];
  timestamp?: Date;
}

export interface UpdateActivityRequest {
  id: string;
  title?: string;
  content?: string;
  mood?: string;
  images: string[];
}

export interface GetActivitiesRequest {
  page: number;
  pageSize: number;
  activityType?: string;
  mood?: string;
  startDate?: Date;
  endDate?: Date;
  sortBy: 'timestamp' | 'coin_change' | 'title';
  sortOrder: 'asc' | 'desc';
  search?: string;
}

export interface GetActivitiesResponse {
  activities: Activity[];
  totalCount: number;
  page: number;
  pageSize: number;
  hasNext: boolean;
}

export interface CreateActivityTypeRequest {
  name: string;
  coinValue: number;
  color: string;
  icon: string;
}

export interface UpdateActivityTypeRequest {
  id: string;
  name?: string;
  coinValue?: number;
  color?: string;
  icon?: string;
}

export interface CreateMoodConfigRequest {
  name: string;
  emoji: string;
  coinModifier: number;
  color: string;
}

export interface UpdateMoodConfigRequest {
  id: string;
  name?: string;
  emoji?: string;
  coinModifier?: number;
  color?: string;
}

export interface UpdateUserSettingsRequest {
  dailyGoal?: number;
  notificationsEnabled?: boolean;
  theme?: string;
}

export interface GetStatsRequest {
  startDate?: Date;
  endDate?: Date;
  period: 'daily' | 'weekly' | 'monthly';
}

export interface GetStatsResponse {
  totalActivities: number;
  totalCoinsEarned: number;
  totalCoinsLost: number;
  netCoins: number;
  dailyStats: DayStats[];
  activityTypeStats: ActivityTypeStats[];
  moodStats: MoodStats[];
}

export interface DayStats {
  date: string; // YYYY-MM-DD
  activityCount: number;
  coinsEarned: number;
  coinsLost: number;
  netCoins: number;
}

export interface ActivityTypeStats {
  activityType: string;
  count: number;
  totalCoins: number;
  avgCoins: number;
}

export interface MoodStats {
  mood: string;
  count: number;
  totalCoins: number;
  avgCoins: number;
}

export interface UploadImageRequest {
  imageData: ArrayBuffer;
  filename: string;
  contentType: string;
}

export interface UploadImageResponse {
  imageUrl: string;
  imageId: string;
}